package com.hsgene.user.domain;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;

import java.util.Date;

/**
 * 商品收藏信息
 *
 * @author wangbing
 * @version 1.0, 2018/8/6
 */
public class GoodsCollection {

    /**
     * 表主键id
     */
    private String id;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 商品id或商品编号
     */
    private String goodsId;

    /**
     * 商品快照id或商品快照编号
     * 记录快照，当编辑修改商品信息，失效快照信息，记录用户收藏期间的商品变化信息（涨价、降价、下架等）
     */
    private String goodsSnapshootId;

    /**
     * 收藏是否有效
     */
    private Boolean available;

    /**
     * 收藏时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date updateTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsSnapshootId() {
        return goodsSnapshootId;
    }

    public void setGoodsSnapshootId(String goodsSnapshootId) {
        this.goodsSnapshootId = goodsSnapshootId;
    }

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
